package easystudy.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import easystudy.dao.MemberDao;
import easystudy.dto.Member;

@Controller
public class DetailController {
	
	private MemberDao memberDao;
	
	public void setMemberDao(MemberDao memberDao){
		this.memberDao = memberDao;
	}
	
	@RequestMapping(value="/member_detail.me")
	protected ModelAndView doMemberDetailProcess(HttpServletRequest req){
		
		HttpSession session = req.getSession();
		int member_num = (Integer)session.getAttribute("num");
		Member member = memberDao.getMemberDetail(member_num);
		return new ModelAndView("member_detail","member",member);
	}

}
